package com.itheima.d1_inner_class1;

/*

 */
public class Demo {
    public static void main(String[] args) {
        // 目标：了解成员内部类和其特点。
        Car.Engine engine = new Car().new Engine();
        engine.start();
    }
}
class Car {
    private String name = "小飞车";
    public void run() {
        System.out.println("小飞车来喽~");
    }

    class Engine {
        private String name = "红星牌";

        public void start() {
            String name = "起飞";
            System.out.println("刀片超车~");

            //访问外部类成分时，省略了  外部类名.this 。如果不冲突，可以省略
            System.out.println("name = " + name);
            System.out.println("this.name = " + this.name);
            System.out.println("Car.this = " + Car.this.name);

            run();
        }
    }
}